package org.jivesoftware.spark.crowd.impl;

import org.jivesoftware.smack.packet.Presence;


public class Member {
	private String bareJID;
	/**
	 * the nick name,or Chinese name,this should be neither the userName nor the node of JID.
	 */
	private String nickName;
	private Presence presence;
	
	public Member(String JID){
		this(JID,null);
	}
	public Member(String bareJID,String nickName){
		this.nickName = nickName;
		this.bareJID = bareJID;
	}
	
	public String getJID() {		
		return bareJID;
	}

	
	public String getNickName() {		
		return nickName;
	}

	
	public Presence getPresence() {		
		return presence;
	}

	
	public void setPresence(Presence p) {
		this.presence = p;		
	}
	/**
	 * if JID equals,we consider them the same one.
	 */
	public boolean equals(Object o){
		if(o == null)
			return false;
		if(o instanceof Member){
			Member m = (Member)o;
			return m.getJID().equals(this.bareJID);
		}else
			return false;
		
	
		
	}
	

}
